package br.unb.plugins.geral.Action;

import java.awt.event.ActionEvent;
import br.unb.utils.Console;

public class DefaultOKAction extends XmlFrameAction {

    public DefaultOKAction() {
        super("defaultOKAction");
    }

    public void actionPerformed(ActionEvent arg0) {
        try {
            if (homeFrame.setParameters()) {
                //Console.println("SetParameters ok", System.err);
                if (homeFrame.isGenaratorReady()) {
                    //Console.println("generator is ready", System.err);
                } else {
                    Console.println("Warning generator is not ready", System.err);
                }
            } else {
                Console.println("SetParameters failed", System.err);
            }
        } catch (Exception e) {
            Console.println("SetParameters failed", System.err);
            return;
        }
        homeFrame.setVisible(false);
        //Console.printError("OK!(pressed)");
    }
}
